//
//  AppDelegate.swift
//  Spark Peso
//
//  Created by 小琦 on 2025/1/27.
//

import UIKit
import AdSupport
import AppTrackingTransparency

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    
    var window: UIWindow?
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
       
        
        window = UIWindow(frame: UIScreen.main.bounds)
        window?.backgroundColor = .white
        
        let vc = XQLaunchController()
        vc.launchOptions = launchOptions
        
        window?.rootViewController = XQBaseNavController(rootViewController: vc)
        window?.makeKeyAndVisible()
        
        return true
    }
    
    func applicationDidBecomeActive(_ application: UIApplication) {
        ATTrackingManager.requestTrackingAuthorization { status in
            let idfa = ASIdentifierManager.shared().advertisingIdentifier.uuidString
            XQCache.saveIdfa(idfa: idfa)
        }
    }
}

